﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using yq.IBase;
using yq.Model.Base;
using cn.Util;

namespace yq.Model.Logic
{
    /// <summary>
    /// User_Account - 用户表 - 对象继承类
    /// </summary>
  
    public class UserAccount : IUserAccount<UserAccount>
    {

        protected override List<string> GetColumns()
        {
            return new List<string>() { "UserId", "NickName", "State", "CreateTtime", "PurviewEnum", "Version" };
        }

        protected override string GetTableName()
        {
            return "User_Account";
        }

        public override IList<string> GetTableNameByCut()
        {
            return new List<string>() { "User_Account", "User_Account_b"};
        }

        public override string GetTableNameByCut(UserAccount t)
        {
            if (t.NickName == "test")
            {
                return "User_Account_b";
            }
            return "User_Account";
        }

        public override string GetTableNameByCut(string id)
        {
            if (id.StartsWith("b_"))
            {
                return "User_Account_b";
            }
            return "User_Account";
        }

        public override string GetNewsId()
        {
            if (NickName == "test")
            {
                return "b_"+Guid.NewGuid().ToString().Replace("-","_");
            }
            return Guid.NewGuid().ToString().Replace("-", "_");
        }
    }
}
